<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class IRB::Context - irb: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link"><a href="../Object.html">Object</a>
</div>

        
        
<div id="extends-section" class="nav-section">
  <h3>Extended With Modules</h3>

  <ul class="link-list">
    <li><a class="extend" href="ExtendCommandBundle.html">IRB::ExtendCommandBundle</a>
    <li><a class="extend" href="ExtendCommandBundle.html">IRB::ExtendCommandBundle</a>
  </ul>
</div>

        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-__exit__">#__exit__</a>
    <li ><a href="#method-i-_set_last_value">#_set_last_value</a>
    <li ><a href="#method-i-change_workspace">#change_workspace</a>
    <li ><a href="#method-i-eval_history-3D">#eval_history=</a>
    <li class="calls-super" ><a href="#method-i-exit">#exit</a>
    <li ><a href="#method-i-file_input-3F">#file_input?</a>
    <li ><a href="#method-i-history_file">#history_file</a>
    <li ><a href="#method-i-history_file-3D">#history_file=</a>
    <li ><a href="#method-i-home_workspace">#home_workspace</a>
    <li ><a href="#method-i-inspect-3F">#inspect?</a>
    <li ><a href="#method-i-inspect_mode-3D">#inspect_mode=</a>
    <li ><a href="#method-i-irb_level">#irb_level</a>
    <li ><a href="#method-i-main">#main</a>
    <li ><a href="#method-i-pop_workspace">#pop_workspace</a>
    <li ><a href="#method-i-prompt_mode-3D">#prompt_mode=</a>
    <li ><a href="#method-i-prompt_n">#prompt_n</a>
    <li ><a href="#method-i-prompt_n-3D">#prompt_n=</a>
    <li ><a href="#method-i-prompting-3F">#prompting?</a>
    <li ><a href="#method-i-push_workspace">#push_workspace</a>
    <li ><a href="#method-i-save_history">#save_history</a>
    <li ><a href="#method-i-save_history-3D">#save_history=</a>
    <li ><a href="#method-i-set_last_value">#set_last_value</a>
    <li ><a href="#method-i-symbol_alias-3F">#symbol_alias?</a>
    <li ><a href="#method-i-transform_args-3F">#transform_args?</a>
    <li ><a href="#method-i-use_loader">#use_loader</a>
    <li ><a href="#method-i-use_loader-3D">#use_loader=</a>
    <li ><a href="#method-i-use_loader-3F">#use_loader?</a>
    <li ><a href="#method-i-use_tracer-3D">#use_tracer=</a>
    <li ><a href="#method-i-verbose-3F">#verbose?</a>
    <li ><a href="#method-i-workspaces">#workspaces</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-IRB::Context">
    <h1 id="class-IRB::Context" class="class">
      class IRB::Context
    </h1>

    <section class="description">
    
<p>A class that wraps the current state of the irb session, including the configuration of <a href="../IRB.html#method-c-conf"><code>IRB.conf</code></a>.</p>

    </section>

      <section id="5Buntitled-5D" class="documentation-section">



        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-ap_name" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">ap_name</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>A copy of the default <code>IRB.conf[:AP_NAME]</code></p>
              </div>
            </div>
          <div id="attribute-i-auto_indent_mode" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">auto_indent_mode</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Can be either the default <code>IRB.conf[:AUTO_INDENT]</code>, or the mode set by <a href="Context.html#method-i-prompt_mode-3D"><code>prompt_mode=</code></a></p>

<p>To disable auto-indentation in irb:</p>

<pre class="ruby"><span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:AUTO_INDENT</span>] = <span class="ruby-keyword">false</span>
</pre>

<p>or</p>

<pre class="ruby"><span class="ruby-identifier">irb_context</span>.<span class="ruby-identifier">auto_indent_mode</span> = <span class="ruby-keyword">false</span>
</pre>

<p>or</p>

<pre class="ruby"><span class="ruby-constant">IRB</span>.<span class="ruby-constant">CurrentContext</span>.<span class="ruby-identifier">auto_indent_mode</span> = <span class="ruby-keyword">false</span>
</pre>

<p>See <a href="../IRB.html#module-IRB-label-Configuration">Configuration at <code>IRB</code></a> for more information.</p>
              </div>
            </div>
          <div id="attribute-i-back_trace_limit" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">back_trace_limit</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>The limit of backtrace lines displayed as top <code>n</code> and tail <code>n</code>.</p>

<p>The default value is 16.</p>

<p>Can also be set using the <code>--back-trace-limit</code> command line option.</p>

<p>See <a href="../IRB.html#module-IRB-label-Command+line+options">Command line options at <code>IRB</code></a> for more command line options.</p>
              </div>
            </div>
          <div id="attribute-i-command_aliases" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">command_aliases</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>User-defined <a href="../IRB.html"><code>IRB</code></a> command aliases</p>
              </div>
            </div>
          <div id="attribute-i-echo" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">echo</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Whether to echo the return value to output or not.</p>

<p>Uses <code>IRB.conf[:ECHO]</code> if available, or defaults to <code>true</code>.</p>

<pre class="ruby"><span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;hello&quot;</span>
<span class="ruby-comment"># hello</span>
<span class="ruby-comment">#=&gt; nil</span>
<span class="ruby-constant">IRB</span>.<span class="ruby-constant">CurrentContext</span>.<span class="ruby-identifier">echo</span> = <span class="ruby-keyword">false</span>
<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;omg&quot;</span>
<span class="ruby-comment"># omg</span>
</pre>
              </div>
            </div>
          <div id="attribute-i-echo-3F" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">echo?</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Whether to echo the return value to output or not.</p>

<p>Uses <code>IRB.conf[:ECHO]</code> if available, or defaults to <code>true</code>.</p>

<pre class="ruby"><span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;hello&quot;</span>
<span class="ruby-comment"># hello</span>
<span class="ruby-comment">#=&gt; nil</span>
<span class="ruby-constant">IRB</span>.<span class="ruby-constant">CurrentContext</span>.<span class="ruby-identifier">echo</span> = <span class="ruby-keyword">false</span>
<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;omg&quot;</span>
<span class="ruby-comment"># omg</span>
</pre>
              </div>
            </div>
          <div id="attribute-i-echo_on_assignment" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">echo_on_assignment</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Whether to echo for assignment expressions.</p>

<p>If set to <code>false</code>, the value of assignment will not be shown.</p>

<p>If set to <code>true</code>, the value of assignment will be shown.</p>

<p>If set to <code>:truncate</code>, the value of assignment will be shown and truncated.</p>

<p>It defaults to <code>:truncate</code>.</p>

<pre class="ruby"><span class="ruby-identifier">a</span> = <span class="ruby-string">&quot;omg&quot;</span>
<span class="ruby-comment">#=&gt; omg</span>

<span class="ruby-identifier">a</span> = <span class="ruby-string">&quot;omg&quot;</span> <span class="ruby-operator">*</span> <span class="ruby-value">10</span>
<span class="ruby-comment">#=&gt; omgomgomgomgomgomgomg...</span>

<span class="ruby-constant">IRB</span>.<span class="ruby-constant">CurrentContext</span>.<span class="ruby-identifier">echo_on_assignment</span> = <span class="ruby-keyword">false</span>
<span class="ruby-identifier">a</span> = <span class="ruby-string">&quot;omg&quot;</span>

<span class="ruby-constant">IRB</span>.<span class="ruby-constant">CurrentContext</span>.<span class="ruby-identifier">echo_on_assignment</span> = <span class="ruby-keyword">true</span>
<span class="ruby-identifier">a</span> = <span class="ruby-string">&quot;omg&quot;</span> <span class="ruby-operator">*</span> <span class="ruby-value">10</span>
<span class="ruby-comment">#=&gt; omgomgomgomgomgomgomgomgomgomg</span>
</pre>

<p>To set the behaviour of showing on assignment in irb:</p>

<pre class="ruby"><span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:ECHO_ON_ASSIGNMENT</span>] = <span class="ruby-value">:truncate</span> <span class="ruby-keyword">or</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">or</span> <span class="ruby-keyword">false</span>
</pre>

<p>or</p>

<pre class="ruby"><span class="ruby-identifier">irb_context</span>.<span class="ruby-identifier">echo_on_assignment</span> = <span class="ruby-value">:truncate</span> <span class="ruby-keyword">or</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">or</span> <span class="ruby-keyword">false</span>
</pre>

<p>or</p>

<pre class="ruby"><span class="ruby-constant">IRB</span>.<span class="ruby-constant">CurrentContext</span>.<span class="ruby-identifier">echo_on_assignment</span> = <span class="ruby-value">:truncate</span> <span class="ruby-keyword">or</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">or</span> <span class="ruby-keyword">false</span>
</pre>
              </div>
            </div>
          <div id="attribute-i-echo_on_assignment-3F" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">echo_on_assignment?</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Whether to echo for assignment expressions.</p>

<p>If set to <code>false</code>, the value of assignment will not be shown.</p>

<p>If set to <code>true</code>, the value of assignment will be shown.</p>

<p>If set to <code>:truncate</code>, the value of assignment will be shown and truncated.</p>

<p>It defaults to <code>:truncate</code>.</p>

<pre class="ruby"><span class="ruby-identifier">a</span> = <span class="ruby-string">&quot;omg&quot;</span>
<span class="ruby-comment">#=&gt; omg</span>

<span class="ruby-identifier">a</span> = <span class="ruby-string">&quot;omg&quot;</span> <span class="ruby-operator">*</span> <span class="ruby-value">10</span>
<span class="ruby-comment">#=&gt; omgomgomgomgomgomgomg...</span>

<span class="ruby-constant">IRB</span>.<span class="ruby-constant">CurrentContext</span>.<span class="ruby-identifier">echo_on_assignment</span> = <span class="ruby-keyword">false</span>
<span class="ruby-identifier">a</span> = <span class="ruby-string">&quot;omg&quot;</span>

<span class="ruby-constant">IRB</span>.<span class="ruby-constant">CurrentContext</span>.<span class="ruby-identifier">echo_on_assignment</span> = <span class="ruby-keyword">true</span>
<span class="ruby-identifier">a</span> = <span class="ruby-string">&quot;omg&quot;</span> <span class="ruby-operator">*</span> <span class="ruby-value">10</span>
<span class="ruby-comment">#=&gt; omgomgomgomgomgomgomgomgomgomg</span>
</pre>

<p>To set the behaviour of showing on assignment in irb:</p>

<pre class="ruby"><span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:ECHO_ON_ASSIGNMENT</span>] = <span class="ruby-value">:truncate</span> <span class="ruby-keyword">or</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">or</span> <span class="ruby-keyword">false</span>
</pre>

<p>or</p>

<pre class="ruby"><span class="ruby-identifier">irb_context</span>.<span class="ruby-identifier">echo_on_assignment</span> = <span class="ruby-value">:truncate</span> <span class="ruby-keyword">or</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">or</span> <span class="ruby-keyword">false</span>
</pre>

<p>or</p>

<pre class="ruby"><span class="ruby-constant">IRB</span>.<span class="ruby-constant">CurrentContext</span>.<span class="ruby-identifier">echo_on_assignment</span> = <span class="ruby-value">:truncate</span> <span class="ruby-keyword">or</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">or</span> <span class="ruby-keyword">false</span>
</pre>
              </div>
            </div>
          <div id="attribute-i-eval_history" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">eval_history</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>The command result history limit. This method is not available until <a href="Context.html#method-i-eval_history-3D"><code>eval_history=</code></a> was called with non-nil value (directly or via setting <code>IRB.conf[:EVAL_HISTORY]</code> in <code>.irbrc</code>).</p>
              </div>
            </div>
          <div id="attribute-i-extra_doc_dirs" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">extra_doc_dirs</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Specify the installation locations of the ri file to be displayed in the document dialog.</p>
              </div>
            </div>
          <div id="attribute-i-ignore_eof" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">ignore_eof</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Whether <code>^D</code> (<code>control-d</code>) will be ignored or not.</p>

<p>If set to <code>false</code>, <code>^D</code> will quit irb.</p>
              </div>
            </div>
          <div id="attribute-i-ignore_eof-3F" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">ignore_eof?</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Whether <code>^D</code> (<code>control-d</code>) will be ignored or not.</p>

<p>If set to <code>false</code>, <code>^D</code> will quit irb.</p>
              </div>
            </div>
          <div id="attribute-i-ignore_sigint" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">ignore_sigint</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Whether <code>^C</code> (<code>control-c</code>) will be ignored or not.</p>

<p>If set to <code>false</code>, <code>^C</code> will quit irb.</p>

<p>If set to <code>true</code>,</p>
<ul><li>
<p>during input:   cancel input then return to top level.</p>
</li><li>
<p>during execute: abandon current execution.</p>
</li></ul>
              </div>
            </div>
          <div id="attribute-i-ignore_sigint-3F" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">ignore_sigint?</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Whether <code>^C</code> (<code>control-c</code>) will be ignored or not.</p>

<p>If set to <code>false</code>, <code>^C</code> will quit irb.</p>

<p>If set to <code>true</code>,</p>
<ul><li>
<p>during input:   cancel input then return to top level.</p>
</li><li>
<p>during execute: abandon current execution.</p>
</li></ul>
              </div>
            </div>
          <div id="attribute-i-inspect_mode" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">inspect_mode</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>A copy of the default <code>IRB.conf[:INSPECT_MODE]</code></p>
              </div>
            </div>
          <div id="attribute-i-io" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">io</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>The current input method.</p>

<p>Can be either <a href="StdioInputMethod.html"><code>StdioInputMethod</code></a>, <a href="ReadlineInputMethod.html"><code>ReadlineInputMethod</code></a>, <a href="RelineInputMethod.html"><code>RelineInputMethod</code></a>, <a href="FileInputMethod.html"><code>FileInputMethod</code></a> or other specified when the context is created. See <a href="Context.html#method-c-new"><code>::new</code></a> for more # information on <code>input_method</code>.</p>
              </div>
            </div>
          <div id="attribute-i-irb" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">irb</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Current irb session.</p>
              </div>
            </div>
          <div id="attribute-i-irb_name" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">irb_name</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Can be either name from <code>IRB.conf[:IRB_NAME]</code>, or the number of the current job set by <a href="JobManager.html"><code>JobManager</code></a>, such as <code>irb#2</code></p>
              </div>
            </div>
          <div id="attribute-i-irb_path" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">irb_path</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Can be either the <a href="Context.html#attribute-i-irb_name"><code>irb_name</code></a> surrounded by parenthesis, or the <code>input_method</code> passed to <a href="Context.html#method-c-new"><code>Context.new</code></a></p>
              </div>
            </div>
          <div id="attribute-i-last_value" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">last_value</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>The return value of the last statement evaluated.</p>
              </div>
            </div>
          <div id="attribute-i-load_modules" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">load_modules</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>A copy of the default <code>IRB.conf[:LOAD_MODULES]</code></p>
              </div>
            </div>
          <div id="attribute-i-newline_before_multiline_output" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">newline_before_multiline_output</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Whether a newline is put before multiline output.</p>

<p>Uses <code>IRB.conf[:NEWLINE_BEFORE_MULTILINE_OUTPUT]</code> if available, or defaults to <code>true</code>.</p>

<pre>&quot;abc\ndef&quot;
#=&gt;
abc
def
IRB.CurrentContext.newline_before_multiline_output = false
&quot;abc\ndef&quot;
#=&gt; abc
def</pre>
              </div>
            </div>
          <div id="attribute-i-newline_before_multiline_output-3F" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">newline_before_multiline_output?</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Whether a newline is put before multiline output.</p>

<p>Uses <code>IRB.conf[:NEWLINE_BEFORE_MULTILINE_OUTPUT]</code> if available, or defaults to <code>true</code>.</p>

<pre>&quot;abc\ndef&quot;
#=&gt;
abc
def
IRB.CurrentContext.newline_before_multiline_output = false
&quot;abc\ndef&quot;
#=&gt; abc
def</pre>
              </div>
            </div>
          <div id="attribute-i-prompt_c" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">prompt_c</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p><a href="../IRB.html"><code>IRB</code></a> prompt for continuated statement. (e.g. immediately after an <code>if</code>)</p>

<p>See <a href="../IRB.html#module-IRB-label-Customizing+the+IRB+Prompt">Customizing the IRB Prompt at <code>IRB</code></a> for more information.</p>
              </div>
            </div>
          <div id="attribute-i-prompt_i" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">prompt_i</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Standard <a href="../IRB.html"><code>IRB</code></a> prompt.</p>

<p>See <a href="../IRB.html#module-IRB-label-Customizing+the+IRB+Prompt">Customizing the IRB Prompt at <code>IRB</code></a> for more information.</p>
              </div>
            </div>
          <div id="attribute-i-prompt_mode" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">prompt_mode</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>A copy of the default <code>IRB.conf[:PROMPT_MODE]</code></p>
              </div>
            </div>
          <div id="attribute-i-prompt_s" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">prompt_s</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p><a href="../IRB.html"><code>IRB</code></a> prompt for continuated strings.</p>

<p>See <a href="../IRB.html#module-IRB-label-Customizing+the+IRB+Prompt">Customizing the IRB Prompt at <code>IRB</code></a> for more information.</p>
              </div>
            </div>
          <div id="attribute-i-rc" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">rc</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>A copy of the default <code>IRB.conf[:RC]</code></p>
              </div>
            </div>
          <div id="attribute-i-rc-3F" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">rc?</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>A copy of the default <code>IRB.conf[:RC]</code></p>
              </div>
            </div>
          <div id="attribute-i-return_format" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">return_format</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>The format of the return statement, set by <a href="Context.html#method-i-prompt_mode-3D"><code>prompt_mode=</code></a> using the <code>:RETURN</code> of the <code>mode</code> passed to set the current <a href="Context.html#attribute-i-prompt_mode"><code>prompt_mode</code></a>.</p>
              </div>
            </div>
          <div id="attribute-i-thread" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">thread</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>The current thread in this context.</p>
              </div>
            </div>
          <div id="attribute-i-use_autocomplete" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">use_autocomplete</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>Whether colorization is enabled or not.</p>

<p>A copy of the default <code>IRB.conf[:USE_AUTOCOMPLETE]</code></p>
              </div>
            </div>
          <div id="attribute-i-use_autocomplete-3F" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">use_autocomplete?</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>Whether colorization is enabled or not.</p>

<p>A copy of the default <code>IRB.conf[:USE_AUTOCOMPLETE]</code></p>
              </div>
            </div>
          <div id="attribute-i-use_multiline" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">use_multiline</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>Whether multiline editor mode is enabled or not.</p>

<p>A copy of the default <code>IRB.conf[:USE_MULTILINE]</code></p>
              </div>
            </div>
          <div id="attribute-i-use_multiline-3F" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">use_multiline?</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>Whether multiline editor mode is enabled or not.</p>

<p>A copy of the default <code>IRB.conf[:USE_MULTILINE]</code></p>
              </div>
            </div>
          <div id="attribute-i-use_readline" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">use_readline</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>Whether singleline editor mode is enabled or not.</p>

<p>A copy of the default <code>IRB.conf[:USE_SINGLELINE]</code></p>
              </div>
            </div>
          <div id="attribute-i-use_readline-3F" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">use_readline?</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>Whether singleline editor mode is enabled or not.</p>

<p>A copy of the default <code>IRB.conf[:USE_SINGLELINE]</code></p>
              </div>
            </div>
          <div id="attribute-i-use_reline" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">use_reline</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>Whether multiline editor mode is enabled or not.</p>

<p>A copy of the default <code>IRB.conf[:USE_MULTILINE]</code></p>
              </div>
            </div>
          <div id="attribute-i-use_reline-3F" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">use_reline?</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>Whether multiline editor mode is enabled or not.</p>

<p>A copy of the default <code>IRB.conf[:USE_MULTILINE]</code></p>
              </div>
            </div>
          <div id="attribute-i-use_singleline" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">use_singleline</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>Whether singleline editor mode is enabled or not.</p>

<p>A copy of the default <code>IRB.conf[:USE_SINGLELINE]</code></p>
              </div>
            </div>
          <div id="attribute-i-use_singleline-3F" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">use_singleline?</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>Whether singleline editor mode is enabled or not.</p>

<p>A copy of the default <code>IRB.conf[:USE_SINGLELINE]</code></p>
              </div>
            </div>
          <div id="attribute-i-use_tracer" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">use_tracer</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>Whether Tracer is used when evaluating statements in this context.</p>

<p>See <code>lib/tracer.rb</code> for more information.</p>
              </div>
            </div>
          <div id="attribute-i-use_tracer-3F" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">use_tracer?</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>Whether Tracer is used when evaluating statements in this context.</p>

<p>See <code>lib/tracer.rb</code> for more information.</p>
              </div>
            </div>
          <div id="attribute-i-verbose" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">verbose</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Whether verbose messages are displayed or not.</p>

<p>A copy of the default <code>IRB.conf[:VERBOSE]</code></p>
              </div>
            </div>
          <div id="attribute-i-with_debugger" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">with_debugger</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-workspace" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">workspace</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p><a href="WorkSpace.html"><code>WorkSpace</code></a> in the current context.</p>
              </div>
            </div>
          <div id="attribute-i-workspace_home" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">workspace_home</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>The toplevel workspace, see <a href="Context.html#method-i-home_workspace"><code>home_workspace</code></a></p>
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">(irb, workspace = nil, input_method = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Creates a new <a href="../IRB.html"><code>IRB</code></a> context.</p>

<p>The optional <code>input_method</code> argument:</p>
<dl class="rdoc-list note-list"><dt><code>nil</code>
<dd>
<p>uses stdin or Reline or Readline</p>
</dd><dt><code>String</code>
<dd>
<p>uses a File</p>
</dd><dt><code>other</code>
<dd>
<p>uses this as <a href="InputMethod.html"><code>InputMethod</code></a></p>
</dd></dl>

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File irb/context.rb, line 23</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">irb</span>, <span class="ruby-identifier">workspace</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">input_method</span> = <span class="ruby-keyword">nil</span>)
      <span class="ruby-ivar">@irb</span> = <span class="ruby-identifier">irb</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">workspace</span>
        <span class="ruby-ivar">@workspace</span> = <span class="ruby-identifier">workspace</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-ivar">@workspace</span> = <span class="ruby-constant">WorkSpace</span>.<span class="ruby-identifier">new</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-ivar">@thread</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>

      <span class="ruby-comment"># copy of default configuration</span>
      <span class="ruby-ivar">@ap_name</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:AP_NAME</span>]
      <span class="ruby-ivar">@rc</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:RC</span>]
      <span class="ruby-ivar">@load_modules</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:LOAD_MODULES</span>]

      <span class="ruby-keyword">if</span> <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-value">:USE_SINGLELINE</span>)
        <span class="ruby-ivar">@use_singleline</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:USE_SINGLELINE</span>]
      <span class="ruby-keyword">elsif</span> <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-value">:USE_READLINE</span>) <span class="ruby-comment"># backward compatibility</span>
        <span class="ruby-ivar">@use_singleline</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:USE_READLINE</span>]
      <span class="ruby-keyword">else</span>
        <span class="ruby-ivar">@use_singleline</span> = <span class="ruby-keyword">nil</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">if</span> <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-value">:USE_MULTILINE</span>)
        <span class="ruby-ivar">@use_multiline</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:USE_MULTILINE</span>]
      <span class="ruby-keyword">elsif</span> <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-value">:USE_RELINE</span>) <span class="ruby-comment"># backward compatibility</span>
        <span class="ruby-identifier">warn</span> <span class="ruby-identifier">&lt;&lt;~MSG</span>.<span class="ruby-identifier">strip</span>
<span class="ruby-value">          USE_RELINE is deprecated, please use USE_MULTILINE instead.
</span><span class="ruby-identifier">        MSG</span>
        <span class="ruby-ivar">@use_multiline</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:USE_RELINE</span>]
      <span class="ruby-keyword">elsif</span> <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-value">:USE_REIDLINE</span>)
        <span class="ruby-identifier">warn</span> <span class="ruby-identifier">&lt;&lt;~MSG</span>.<span class="ruby-identifier">strip</span>
<span class="ruby-value">          USE_REIDLINE is deprecated, please use USE_MULTILINE instead.
</span><span class="ruby-identifier">        MSG</span>
        <span class="ruby-ivar">@use_multiline</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:USE_REIDLINE</span>]
      <span class="ruby-keyword">else</span>
        <span class="ruby-ivar">@use_multiline</span> = <span class="ruby-keyword">nil</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-ivar">@use_autocomplete</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:USE_AUTOCOMPLETE</span>]
      <span class="ruby-ivar">@verbose</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:VERBOSE</span>]
      <span class="ruby-ivar">@io</span> = <span class="ruby-keyword">nil</span>

      <span class="ruby-keyword">self</span>.<span class="ruby-identifier">inspect_mode</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:INSPECT_MODE</span>]
      <span class="ruby-keyword">self</span>.<span class="ruby-identifier">use_tracer</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:USE_TRACER</span>] <span class="ruby-keyword">if</span> <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:USE_TRACER</span>]
      <span class="ruby-keyword">self</span>.<span class="ruby-identifier">use_loader</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:USE_LOADER</span>] <span class="ruby-keyword">if</span> <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:USE_LOADER</span>]
      <span class="ruby-keyword">self</span>.<span class="ruby-identifier">eval_history</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:EVAL_HISTORY</span>] <span class="ruby-keyword">if</span> <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:EVAL_HISTORY</span>]

      <span class="ruby-ivar">@ignore_sigint</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:IGNORE_SIGINT</span>]
      <span class="ruby-ivar">@ignore_eof</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:IGNORE_EOF</span>]

      <span class="ruby-ivar">@back_trace_limit</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:BACK_TRACE_LIMIT</span>]

      <span class="ruby-keyword">self</span>.<span class="ruby-identifier">prompt_mode</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:PROMPT_MODE</span>]

      <span class="ruby-keyword">if</span> <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:SINGLE_IRB</span>] <span class="ruby-keyword">or</span> <span class="ruby-operator">!</span><span class="ruby-keyword">defined?</span>(<span class="ruby-constant">IRB</span><span class="ruby-operator">::</span><span class="ruby-constant">JobManager</span>)
        <span class="ruby-ivar">@irb_name</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:IRB_NAME</span>]
      <span class="ruby-keyword">else</span>
        <span class="ruby-ivar">@irb_name</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:IRB_NAME</span>]<span class="ruby-string">+&quot;#&quot;</span><span class="ruby-operator">+</span><span class="ruby-constant">IRB</span>.<span class="ruby-constant">JobManager</span>.<span class="ruby-identifier">n_jobs</span>.<span class="ruby-identifier">to_s</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-ivar">@irb_path</span> = <span class="ruby-string">&quot;(&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@irb_name</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot;)&quot;</span>

      <span class="ruby-keyword">case</span> <span class="ruby-identifier">input_method</span>
      <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>
        <span class="ruby-ivar">@io</span> = <span class="ruby-keyword">nil</span>
        <span class="ruby-keyword">case</span> <span class="ruby-identifier">use_multiline?</span>
        <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>
          <span class="ruby-keyword">if</span> <span class="ruby-constant">STDIN</span>.<span class="ruby-identifier">tty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:PROMPT_MODE</span>] <span class="ruby-operator">!=</span> <span class="ruby-value">:INF_RUBY</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">use_singleline?</span>
            <span class="ruby-comment"># Both of multiline mode and singleline mode aren&#39;t specified.</span>
            <span class="ruby-ivar">@io</span> = <span class="ruby-constant">RelineInputMethod</span>.<span class="ruby-identifier">new</span>
          <span class="ruby-keyword">else</span>
            <span class="ruby-ivar">@io</span> = <span class="ruby-keyword">nil</span>
          <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">when</span> <span class="ruby-keyword">false</span>
          <span class="ruby-ivar">@io</span> = <span class="ruby-keyword">nil</span>
        <span class="ruby-keyword">when</span> <span class="ruby-keyword">true</span>
          <span class="ruby-ivar">@io</span> = <span class="ruby-constant">RelineInputMethod</span>.<span class="ruby-identifier">new</span>
        <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@io</span>
          <span class="ruby-keyword">case</span> <span class="ruby-identifier">use_singleline?</span>
          <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>
            <span class="ruby-keyword">if</span> (<span class="ruby-keyword">defined?</span>(<span class="ruby-constant">ReadlineInputMethod</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">STDIN</span>.<span class="ruby-identifier">tty?</span> <span class="ruby-operator">&amp;&amp;</span>
                <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:PROMPT_MODE</span>] <span class="ruby-operator">!=</span> <span class="ruby-value">:INF_RUBY</span>)
              <span class="ruby-ivar">@io</span> = <span class="ruby-constant">ReadlineInputMethod</span>.<span class="ruby-identifier">new</span>
            <span class="ruby-keyword">else</span>
              <span class="ruby-ivar">@io</span> = <span class="ruby-keyword">nil</span>
            <span class="ruby-keyword">end</span>
          <span class="ruby-keyword">when</span> <span class="ruby-keyword">false</span>
            <span class="ruby-ivar">@io</span> = <span class="ruby-keyword">nil</span>
          <span class="ruby-keyword">when</span> <span class="ruby-keyword">true</span>
            <span class="ruby-keyword">if</span> <span class="ruby-keyword">defined?</span>(<span class="ruby-constant">ReadlineInputMethod</span>)
              <span class="ruby-ivar">@io</span> = <span class="ruby-constant">ReadlineInputMethod</span>.<span class="ruby-identifier">new</span>
            <span class="ruby-keyword">else</span>
              <span class="ruby-ivar">@io</span> = <span class="ruby-keyword">nil</span>
            <span class="ruby-keyword">end</span>
          <span class="ruby-keyword">else</span>
            <span class="ruby-ivar">@io</span> = <span class="ruby-keyword">nil</span>
          <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">end</span>
        <span class="ruby-ivar">@io</span> = <span class="ruby-constant">StdioInputMethod</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@io</span>

      <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;-&#39;</span>
        <span class="ruby-ivar">@io</span> = <span class="ruby-constant">FileInputMethod</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">$stdin</span>)
        <span class="ruby-ivar">@irb_name</span> = <span class="ruby-string">&#39;-&#39;</span>
        <span class="ruby-ivar">@irb_path</span> = <span class="ruby-string">&#39;-&#39;</span>
      <span class="ruby-keyword">when</span> <span class="ruby-constant">String</span>
        <span class="ruby-ivar">@io</span> = <span class="ruby-constant">FileInputMethod</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">input_method</span>)
        <span class="ruby-ivar">@irb_name</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">input_method</span>)
        <span class="ruby-ivar">@irb_path</span> = <span class="ruby-identifier">input_method</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-ivar">@io</span> = <span class="ruby-identifier">input_method</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-ivar">@extra_doc_dirs</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:EXTRA_DOC_DIRS</span>]

      <span class="ruby-ivar">@echo</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:ECHO</span>]
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@echo</span>.<span class="ruby-identifier">nil?</span>
        <span class="ruby-ivar">@echo</span> = <span class="ruby-keyword">true</span>
      <span class="ruby-keyword">end</span>

      <span class="ruby-ivar">@echo_on_assignment</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:ECHO_ON_ASSIGNMENT</span>]
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@echo_on_assignment</span>.<span class="ruby-identifier">nil?</span>
        <span class="ruby-ivar">@echo_on_assignment</span> = <span class="ruby-value">:truncate</span>
      <span class="ruby-keyword">end</span>

      <span class="ruby-ivar">@newline_before_multiline_output</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:NEWLINE_BEFORE_MULTILINE_OUTPUT</span>]
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@newline_before_multiline_output</span>.<span class="ruby-identifier">nil?</span>
        <span class="ruby-ivar">@newline_before_multiline_output</span> = <span class="ruby-keyword">true</span>
      <span class="ruby-keyword">end</span>

      <span class="ruby-ivar">@command_aliases</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:COMMAND_ALIASES</span>]
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-__exit__" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">__exit__</span><span
                                class="method-args">(ret = 0)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="Context.html#method-i-exit">exit</a>
                            </div>
                          </div>

                  <div id="method-i-_set_last_value" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">_set_last_value</span><span
                                class="method-args">(value)</span>
                            </div>

                            <div class="method-description">
                              <p>See <a href="Context.html#method-i-set_last_value"><code>set_last_value</code></a></p>

                            </div>


                            <div class="aliases">
                              Alias for: <a href="Context.html#method-i-set_last_value">set_last_value</a>
                            </div>
                          </div>

                  <div id="method-i-change_workspace" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">change_workspace</span><span
                                class="method-args">(*_main)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Changes the current workspace to given object or binding.</p>

<p>If the optional argument is omitted, the workspace will be <a href="Context.html#method-i-home_workspace"><code>home_workspace</code></a> which is inherited from <code>TOPLEVEL_BINDING</code> or the main object, <code>IRB.conf[:MAIN_CONTEXT]</code> when irb was initialized.</p>

<p>See <a href="WorkSpace.html#method-c-new"><code>IRB::WorkSpace.new</code></a> for more information.</p>

                              <div class="method-source-code" id="change_workspace-source">
            <pre><span class="ruby-comment"># File irb/ext/change-ws.rb, line 26</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">change_workspace</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">_main</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">_main</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-ivar">@workspace</span> = <span class="ruby-identifier">home_workspace</span>
    <span class="ruby-keyword">return</span> <span class="ruby-identifier">main</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@workspace</span> = <span class="ruby-constant">WorkSpace</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">_main</span>[<span class="ruby-value">0</span>])

  <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span>(<span class="ruby-keyword">class</span><span class="ruby-operator">&lt;&lt;</span><span class="ruby-identifier">main</span>;<span class="ruby-identifier">ancestors</span>;<span class="ruby-keyword">end</span>).<span class="ruby-identifier">include?</span>(<span class="ruby-constant">ExtendCommandBundle</span>)
    <span class="ruby-identifier">main</span>.<span class="ruby-identifier">extend</span> <span class="ruby-constant">ExtendCommandBundle</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-eval_history-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">eval_history=</span><span
                                class="method-args">(no)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Sets command result history limit. Default value is set from <code>IRB.conf[:EVAL_HISTORY]</code>.</p>

<p><code>no</code> is an Integer or <code>nil</code>.</p>

<p>Returns <code>no</code> of history items if greater than 0.</p>

<p>If <code>no</code> is 0, the number of history items is unlimited.</p>

<p>If <code>no</code> is <code>nil</code>, execution result history isn’t used (default).</p>

<p><a href="EvalHistory.html"><code>EvalHistory</code></a> values are available via <code>__</code> variable, see <a href="EvalHistory.html"><code>IRB::EvalHistory</code></a>.</p>

                              <div class="method-source-code" id="eval_history-3D-source">
            <pre><span class="ruby-comment"># File irb/ext/eval_history.rb, line 45</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">eval_history=</span>(<span class="ruby-identifier">no</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">no</span>
    <span class="ruby-keyword">if</span> <span class="ruby-keyword">defined?</span>(<span class="ruby-ivar">@eval_history</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@eval_history</span>
      <span class="ruby-ivar">@eval_history_values</span>.<span class="ruby-identifier">size</span>(<span class="ruby-identifier">no</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-ivar">@eval_history_values</span> = <span class="ruby-constant">EvalHistory</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">no</span>)
      <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:__TMP__EHV__</span>] = <span class="ruby-ivar">@eval_history_values</span>
      <span class="ruby-ivar">@workspace</span>.<span class="ruby-identifier">evaluate</span>(<span class="ruby-string">&quot;__ = IRB.conf[:__TMP__EHV__]&quot;</span>)
      <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:__TMP_EHV__</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@eval_history_values</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@eval_history</span> = <span class="ruby-identifier">no</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-exit" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">exit</span><span
                                class="method-args">(ret = 0)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Exits the current session, see <a href="../IRB.html#method-c-irb_exit"><code>IRB.irb_exit</code></a></p>
                                <div class="method-calls-super">
                                  Calls superclass method
                                  
                              </div>

                              <div class="method-source-code" id="exit-source">
            <pre><span class="ruby-comment"># File irb/context.rb, line 537</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">exit</span>(<span class="ruby-identifier">ret</span> = <span class="ruby-value">0</span>)
  <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">irb_exit</span>(<span class="ruby-ivar">@irb</span>, <span class="ruby-identifier">ret</span>)
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">UncaughtThrowError</span>
  <span class="ruby-keyword">super</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="Context.html#method-i-__exit__">__exit__</a>
                            </div>

                          </div>

                  <div id="method-i-file_input-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">file_input?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Whether <a href="Context.html#attribute-i-io"><code>io</code></a> uses a File for the <code>input_method</code> passed when creating the current context, see <a href="Context.html#method-c-new"><code>::new</code></a></p>

                              <div class="method-source-code" id="file_input-3F-source">
            <pre><span class="ruby-comment"># File irb/context.rb, line 444</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">file_input?</span>
  <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">FileInputMethod</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-history_file" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">history_file</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>A copy of the default <code>IRB.conf[:HISTORY_FILE]</code></p>

                              <div class="method-source-code" id="history_file-source">
            <pre><span class="ruby-comment"># File irb/context.rb, line 161</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">history_file</span>
  <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:HISTORY_FILE</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-history_file-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">history_file=</span><span
                                class="method-args">(hist)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Set <code>IRB.conf[:HISTORY_FILE]</code> to the given <code>hist</code>.</p>

                              <div class="method-source-code" id="history_file-3D-source">
            <pre><span class="ruby-comment"># File irb/context.rb, line 166</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">history_file=</span>(<span class="ruby-identifier">hist</span>)
  <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:HISTORY_FILE</span>] = <span class="ruby-identifier">hist</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-home_workspace" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">home_workspace</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Inherited from <code>TOPLEVEL_BINDING</code>.</p>

                              <div class="method-source-code" id="home_workspace-source">
            <pre><span class="ruby-comment"># File irb/ext/change-ws.rb, line 11</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">home_workspace</span>
  <span class="ruby-keyword">if</span> <span class="ruby-keyword">defined?</span> <span class="ruby-ivar">@home_workspace</span>
    <span class="ruby-ivar">@home_workspace</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@home_workspace</span> = <span class="ruby-ivar">@workspace</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-inspect-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">inspect?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Whether <a href="Context.html#attribute-i-inspect_mode"><code>inspect_mode</code></a> is set or not, see <a href="Context.html#method-i-inspect_mode-3D"><code>inspect_mode=</code></a> for more detail.</p>

                              <div class="method-source-code" id="inspect-3F-source">
            <pre><span class="ruby-comment"># File irb/context.rb, line 438</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">inspect?</span>
  <span class="ruby-ivar">@inspect_mode</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">or</span> <span class="ruby-ivar">@inspect_mode</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-inspect_mode-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">inspect_mode=</span><span
                                class="method-args">(opt)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Specifies the inspect mode with <code>opt</code>:</p>
<dl class="rdoc-list note-list"><dt><code>true</code>
<dd>
<p>display <code>inspect</code></p>
</dd><dt><code>false</code>
<dd>
<p>display <code>to_s</code></p>
</dd><dt><code>nil</code>
<dd>
<p>inspect mode in non-math mode, non-inspect mode in math mode</p>
</dd></dl>

<p>See <a href="Inspector.html"><code>IRB::Inspector</code></a> for more information.</p>

<p>Can also be set using the <code>--inspect</code> and <code>--noinspect</code> command line options.</p>

<p>See <a href="../IRB.html#module-IRB-label-Command+line+options">Command line options at <code>IRB</code></a> for more command line options.</p>

                              <div class="method-source-code" id="inspect_mode-3D-source">
            <pre><span class="ruby-comment"># File irb/context.rb, line 461</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">inspect_mode=</span>(<span class="ruby-identifier">opt</span>)

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">i</span> = <span class="ruby-constant">Inspector</span><span class="ruby-operator">::</span><span class="ruby-constant">INSPECTORS</span>[<span class="ruby-identifier">opt</span>]
    <span class="ruby-ivar">@inspect_mode</span> = <span class="ruby-identifier">opt</span>
    <span class="ruby-ivar">@inspect_method</span> = <span class="ruby-identifier">i</span>
    <span class="ruby-identifier">i</span>.<span class="ruby-identifier">init</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">opt</span>
    <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>
      <span class="ruby-keyword">if</span> <span class="ruby-constant">Inspector</span>.<span class="ruby-identifier">keys_with_inspector</span>(<span class="ruby-constant">Inspector</span><span class="ruby-operator">::</span><span class="ruby-constant">INSPECTORS</span>[<span class="ruby-keyword">true</span>]).<span class="ruby-identifier">include?</span>(<span class="ruby-ivar">@inspect_mode</span>)
        <span class="ruby-keyword">self</span>.<span class="ruby-identifier">inspect_mode</span> = <span class="ruby-keyword">false</span>
      <span class="ruby-keyword">elsif</span> <span class="ruby-constant">Inspector</span>.<span class="ruby-identifier">keys_with_inspector</span>(<span class="ruby-constant">Inspector</span><span class="ruby-operator">::</span><span class="ruby-constant">INSPECTORS</span>[<span class="ruby-keyword">false</span>]).<span class="ruby-identifier">include?</span>(<span class="ruby-ivar">@inspect_mode</span>)
        <span class="ruby-keyword">self</span>.<span class="ruby-identifier">inspect_mode</span> = <span class="ruby-keyword">true</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;Can&#39;t switch inspect mode.&quot;</span>
        <span class="ruby-keyword">return</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/^\s*\{.*\}\s*$/</span>
      <span class="ruby-keyword">begin</span>
        <span class="ruby-identifier">inspector</span> = <span class="ruby-identifier">eval</span> <span class="ruby-node">&quot;proc#{opt}&quot;</span>
      <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span>
        <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Can&#39;t switch inspect mode(#{opt}).&quot;</span>
        <span class="ruby-keyword">return</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">self</span>.<span class="ruby-identifier">inspect_mode</span> = <span class="ruby-identifier">inspector</span>
    <span class="ruby-keyword">when</span> <span class="ruby-constant">Proc</span>
      <span class="ruby-keyword">self</span>.<span class="ruby-identifier">inspect_mode</span> = <span class="ruby-constant">IRB</span><span class="ruby-operator">::</span><span class="ruby-constant">Inspector</span>(<span class="ruby-identifier">opt</span>)
    <span class="ruby-keyword">when</span> <span class="ruby-constant">Inspector</span>
      <span class="ruby-identifier">prefix</span> = <span class="ruby-string">&quot;usr%d&quot;</span>
      <span class="ruby-identifier">i</span> = <span class="ruby-value">1</span>
      <span class="ruby-keyword">while</span> <span class="ruby-constant">Inspector</span><span class="ruby-operator">::</span><span class="ruby-constant">INSPECTORS</span>[<span class="ruby-identifier">format</span>(<span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">i</span>)]; <span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>; <span class="ruby-keyword">end</span>
      <span class="ruby-ivar">@inspect_mode</span> = <span class="ruby-identifier">format</span>(<span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">i</span>)
      <span class="ruby-ivar">@inspect_method</span> = <span class="ruby-identifier">opt</span>
      <span class="ruby-constant">Inspector</span>.<span class="ruby-identifier">def_inspector</span>(<span class="ruby-identifier">format</span>(<span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">i</span>), <span class="ruby-ivar">@inspect_method</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Can&#39;t switch inspect mode(#{opt}).&quot;</span>
      <span class="ruby-keyword">return</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">print</span> <span class="ruby-node">&quot;Switch to#{unless @inspect_mode; &#39; non&#39;;end} inspect mode.\n&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">verbose?</span>
  <span class="ruby-ivar">@inspect_mode</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-irb_level" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">irb_level</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Size of the current <a href="WorkSpace.html"><code>WorkSpace</code></a> stack</p>

                              <div class="method-source-code" id="irb_level-source">
            <pre><span class="ruby-comment"># File irb/ext/workspaces.rb, line 11</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">irb_level</span>
  <span class="ruby-identifier">workspace_stack</span>.<span class="ruby-identifier">size</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-main" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">main</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>The top-level workspace, see <a href="WorkSpace.html#attribute-i-main"><code>WorkSpace#main</code></a></p>

                              <div class="method-source-code" id="main-source">
            <pre><span class="ruby-comment"># File irb/context.rb, line 171</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">main</span>
  <span class="ruby-ivar">@workspace</span>.<span class="ruby-identifier">main</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-pop_workspace" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">pop_workspace</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Removes the last element from the current <a href="Context.html#method-i-workspaces"><code>workspaces</code></a> stack and returns it, or <code>nil</code> if the current workspace stack is empty.</p>

<p>Also, see <a href="Context.html#method-i-push_workspace"><code>push_workspace</code></a>.</p>

                              <div class="method-source-code" id="pop_workspace-source">
            <pre><span class="ruby-comment"># File irb/ext/workspaces.rb, line 52</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">pop_workspace</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">workspaces</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-identifier">print</span> <span class="ruby-string">&quot;workspace stack empty\n&quot;</span>
    <span class="ruby-keyword">return</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@workspace</span> = <span class="ruby-identifier">workspaces</span>.<span class="ruby-identifier">pop</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-prompt_mode-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">prompt_mode=</span><span
                                class="method-args">(mode)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Sets the <code>mode</code> of the prompt in this context.</p>

<p>See <a href="../IRB.html#module-IRB-label-Customizing+the+IRB+Prompt">Customizing the IRB Prompt at <code>IRB</code></a> for more information.</p>

                              <div class="method-source-code" id="prompt_mode-3D-source">
            <pre><span class="ruby-comment"># File irb/context.rb, line 422</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">prompt_mode=</span>(<span class="ruby-identifier">mode</span>)
  <span class="ruby-ivar">@prompt_mode</span> = <span class="ruby-identifier">mode</span>
  <span class="ruby-identifier">pconf</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:PROMPT</span>][<span class="ruby-identifier">mode</span>]
  <span class="ruby-ivar">@prompt_i</span> = <span class="ruby-identifier">pconf</span>[<span class="ruby-value">:PROMPT_I</span>]
  <span class="ruby-ivar">@prompt_s</span> = <span class="ruby-identifier">pconf</span>[<span class="ruby-value">:PROMPT_S</span>]
  <span class="ruby-ivar">@prompt_c</span> = <span class="ruby-identifier">pconf</span>[<span class="ruby-value">:PROMPT_C</span>]
  <span class="ruby-ivar">@return_format</span> = <span class="ruby-identifier">pconf</span>[<span class="ruby-value">:RETURN</span>]
  <span class="ruby-ivar">@return_format</span> = <span class="ruby-string">&quot;%s\n&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@return_format</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">ai</span> = <span class="ruby-identifier">pconf</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value">:AUTO_INDENT</span>)
    <span class="ruby-ivar">@auto_indent_mode</span> = <span class="ruby-identifier">ai</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@auto_indent_mode</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:AUTO_INDENT</span>]
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-prompt_n" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">prompt_n</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>TODO: Remove this when developing v2.0</p>

                              <div class="method-source-code" id="prompt_n-source">
            <pre><span class="ruby-comment"># File irb/context.rb, line 234</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">prompt_n</span>
  <span class="ruby-identifier">warn</span> <span class="ruby-string">&quot;IRB::Context#prompt_n is deprecated and will be removed in the next major release.&quot;</span>
  <span class="ruby-string">&quot;&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-prompt_n-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">prompt_n=</span><span
                                class="method-args">(_)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>TODO: Remove this when developing v2.0</p>

                              <div class="method-source-code" id="prompt_n-3D-source">
            <pre><span class="ruby-comment"># File irb/context.rb, line 240</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">prompt_n=</span>(<span class="ruby-identifier">_</span>)
  <span class="ruby-identifier">warn</span> <span class="ruby-string">&quot;IRB::Context#prompt_n= is deprecated and will be removed in the next major release.&quot;</span>
  <span class="ruby-string">&quot;&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-prompting-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">prompting?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Whether <a href="Context.html#method-i-verbose-3F"><code>verbose?</code></a> is <code>true</code>, and <code>input_method</code> is either <a href="StdioInputMethod.html"><code>StdioInputMethod</code></a> or <a href="RelineInputMethod.html"><code>RelineInputMethod</code></a> or <a href="ReadlineInputMethod.html"><code>ReadlineInputMethod</code></a>, see <a href="Context.html#attribute-i-io"><code>io</code></a> for more information.</p>

                              <div class="method-source-code" id="prompting-3F-source">
            <pre><span class="ruby-comment"># File irb/context.rb, line 403</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">prompting?</span>
  <span class="ruby-identifier">verbose?</span> <span class="ruby-operator">||</span> (<span class="ruby-constant">STDIN</span>.<span class="ruby-identifier">tty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">StdioInputMethod</span>) <span class="ruby-operator">||</span>
               <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">RelineInputMethod</span>) <span class="ruby-operator">||</span>
               (<span class="ruby-keyword">defined?</span>(<span class="ruby-constant">ReadlineInputMethod</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">ReadlineInputMethod</span>)))
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-push_workspace" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">push_workspace</span><span
                                class="method-args">(*_main)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Creates a new workspace with the given object or binding, and appends it onto the current <a href="Context.html#method-i-workspaces"><code>workspaces</code></a> stack.</p>

<p>See <a href="Context.html#method-i-change_workspace"><code>IRB::Context#change_workspace</code></a> and <a href="WorkSpace.html#method-c-new"><code>IRB::WorkSpace.new</code></a> for more information.</p>

                              <div class="method-source-code" id="push_workspace-source">
            <pre><span class="ruby-comment"># File irb/ext/workspaces.rb, line 29</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">push_workspace</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">_main</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">_main</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">workspaces</span>.<span class="ruby-identifier">empty?</span>
      <span class="ruby-identifier">print</span> <span class="ruby-string">&quot;No other workspace\n&quot;</span>
      <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">ws</span> = <span class="ruby-identifier">workspaces</span>.<span class="ruby-identifier">pop</span>
    <span class="ruby-identifier">workspaces</span>.<span class="ruby-identifier">push</span> <span class="ruby-ivar">@workspace</span>
    <span class="ruby-ivar">@workspace</span> = <span class="ruby-identifier">ws</span>
    <span class="ruby-keyword">return</span> <span class="ruby-identifier">workspaces</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">workspaces</span>.<span class="ruby-identifier">push</span> <span class="ruby-ivar">@workspace</span>
  <span class="ruby-ivar">@workspace</span> = <span class="ruby-constant">WorkSpace</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@workspace</span>.<span class="ruby-identifier">binding</span>, <span class="ruby-identifier">_main</span>[<span class="ruby-value">0</span>])
  <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span>(<span class="ruby-keyword">class</span><span class="ruby-operator">&lt;&lt;</span><span class="ruby-identifier">main</span>;<span class="ruby-identifier">ancestors</span>;<span class="ruby-keyword">end</span>).<span class="ruby-identifier">include?</span>(<span class="ruby-constant">ExtendCommandBundle</span>)
    <span class="ruby-identifier">main</span>.<span class="ruby-identifier">extend</span> <span class="ruby-constant">ExtendCommandBundle</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-save_history" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">save_history</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="save_history-source">
            <pre><span class="ruby-comment"># File irb/context.rb, line 156</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">save_history</span>
  <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:SAVE_HISTORY</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-save_history-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">save_history=</span><span
                                class="method-args">(val)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="save_history-3D-source">
            <pre><span class="ruby-comment"># File irb/context.rb, line 152</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">save_history=</span>(<span class="ruby-identifier">val</span>)
  <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:SAVE_HISTORY</span>] = <span class="ruby-identifier">val</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-set_last_value" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">set_last_value</span><span
                                class="method-args">(value)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Sets the return value from the last statement evaluated in this context to <a href="Context.html#attribute-i-last_value"><code>last_value</code></a>.</p>

                              <div class="method-source-code" id="set_last_value-source">
            <pre><span class="ruby-comment"># File irb/context.rb, line 414</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">set_last_value</span>(<span class="ruby-identifier">value</span>)
  <span class="ruby-ivar">@last_value</span> = <span class="ruby-identifier">value</span>
  <span class="ruby-ivar">@workspace</span>.<span class="ruby-identifier">local_variable_set</span> <span class="ruby-value">:_</span>, <span class="ruby-identifier">value</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="Context.html#method-i-_set_last_value">_set_last_value</a>
                            </div>

                          </div>

                  <div id="method-i-symbol_alias-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">symbol_alias?</span><span
                                class="method-args">(command)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Return true if it’s aliased from the argument and it’s not an identifier.</p>

                              <div class="method-source-code" id="symbol_alias-3F-source">
            <pre><span class="ruby-comment"># File irb/context.rb, line 575</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">symbol_alias?</span>(<span class="ruby-identifier">command</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">command</span>.<span class="ruby-identifier">match?</span>(<span class="ruby-regexp">/\A\w+\z/</span>)
  <span class="ruby-identifier">command_aliases</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">command</span>.<span class="ruby-identifier">to_sym</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-transform_args-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">transform_args?</span><span
                                class="method-args">(command)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Return true if the command supports transforming args</p>

                              <div class="method-source-code" id="transform_args-3F-source">
            <pre><span class="ruby-comment"># File irb/context.rb, line 581</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">transform_args?</span>(<span class="ruby-identifier">command</span>)
  <span class="ruby-identifier">command</span> = <span class="ruby-identifier">command_aliases</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">command</span>.<span class="ruby-identifier">to_sym</span>, <span class="ruby-identifier">command</span>)
  <span class="ruby-constant">ExtendCommandBundle</span>.<span class="ruby-identifier">load_command</span>(<span class="ruby-identifier">command</span>)&amp;.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:transform_args</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-use_loader" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">use_loader</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns whether <code>irb</code>‘s own file reader method is used by <code>load</code>/<code>require</code> or not.</p>

<p>This mode is globally affected (irb-wide).</p>

                              <div class="method-source-code" id="use_loader-source">
            <pre><span class="ruby-comment"># File irb/ext/use-loader.rb, line 37</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">use_loader</span>
  <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:USE_LOADER</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="Context.html#method-i-use_loader-3F">use_loader?</a>
                            </div>

                          </div>

                  <div id="method-i-use_loader-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">use_loader=</span><span
                                class="method-args">(opt)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Sets <code>IRB.conf[:USE_LOADER]</code></p>

<p>See <a href="Context.html#method-i-use_loader"><code>use_loader</code></a> for more information.</p>

                              <div class="method-source-code" id="use_loader-3D-source">
            <pre><span class="ruby-comment"># File irb/ext/use-loader.rb, line 47</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">use_loader=</span>(<span class="ruby-identifier">opt</span>)

  <span class="ruby-keyword">if</span> <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:USE_LOADER</span>] <span class="ruby-operator">!=</span> <span class="ruby-identifier">opt</span>
    <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">conf</span>[<span class="ruby-value">:USE_LOADER</span>] = <span class="ruby-identifier">opt</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">opt</span>
      <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">$&quot;</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-string">&quot;irb/cmd/load&quot;</span>)
      <span class="ruby-keyword">end</span>
      (<span class="ruby-keyword">class</span><span class="ruby-operator">&lt;&lt;</span><span class="ruby-ivar">@workspace</span>.<span class="ruby-identifier">main</span>;<span class="ruby-keyword">self</span>;<span class="ruby-keyword">end</span>).<span class="ruby-identifier">instance_eval</span> {
        <span class="ruby-identifier">alias_method</span> <span class="ruby-value">:load</span>, <span class="ruby-value">:irb_load</span>
        <span class="ruby-identifier">alias_method</span> <span class="ruby-value">:require</span>, <span class="ruby-value">:irb_require</span>
      }
    <span class="ruby-keyword">else</span>
      (<span class="ruby-keyword">class</span><span class="ruby-operator">&lt;&lt;</span><span class="ruby-ivar">@workspace</span>.<span class="ruby-identifier">main</span>;<span class="ruby-keyword">self</span>;<span class="ruby-keyword">end</span>).<span class="ruby-identifier">instance_eval</span> {
        <span class="ruby-identifier">alias_method</span> <span class="ruby-value">:load</span>, <span class="ruby-value">:__original__load__IRB_use_loader__</span>
        <span class="ruby-identifier">alias_method</span> <span class="ruby-value">:require</span>, <span class="ruby-value">:__original__require__IRB_use_loader__</span>
      }
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">print</span> <span class="ruby-node">&quot;Switch to load/require#{unless use_loader; &#39; non&#39;;end} trace mode.\n&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">verbose?</span>
  <span class="ruby-identifier">opt</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-use_loader-3F" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">use_loader?</span><span
                                class="method-args">()</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="Context.html#method-i-use_loader">use_loader</a>
                            </div>
                          </div>

                  <div id="method-i-use_tracer-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">use_tracer=</span><span
                                class="method-args">(opt)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="use_tracer-3D-source">
            <pre><span class="ruby-comment"># File irb/ext/tracer.rb, line 13</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">use_tracer=</span>(<span class="ruby-identifier">opt</span>)
  <span class="ruby-comment"># do nothing</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-verbose-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">verbose?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns whether messages are displayed or not.</p>

                              <div class="method-source-code" id="verbose-3F-source">
            <pre><span class="ruby-comment"># File irb/context.rb, line 384</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">verbose?</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@verbose</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">RelineInputMethod</span>)
      <span class="ruby-keyword">false</span>
    <span class="ruby-keyword">elsif</span> <span class="ruby-keyword">defined?</span>(<span class="ruby-constant">ReadlineInputMethod</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">ReadlineInputMethod</span>)
      <span class="ruby-keyword">false</span>
    <span class="ruby-keyword">elsif</span> <span class="ruby-operator">!</span><span class="ruby-constant">STDIN</span>.<span class="ruby-identifier">tty?</span> <span class="ruby-keyword">or</span> <span class="ruby-ivar">@io</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">FileInputMethod</span>)
      <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">false</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@verbose</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-workspaces" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">workspaces</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>WorkSpaces in the current stack</p>

                              <div class="method-source-code" id="workspaces-source">
            <pre><span class="ruby-comment"># File irb/ext/workspaces.rb, line 16</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">workspaces</span>
  <span class="ruby-keyword">if</span> <span class="ruby-keyword">defined?</span> <span class="ruby-ivar">@workspaces</span>
    <span class="ruby-ivar">@workspaces</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@workspaces</span> = []
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is a service of <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>, purveyors of fine <a href='https://jamesbritt.bandcamp.com/'>dance noise</a></p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

